package com.itheima.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.service.UserService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

@Service(interfaceClass = UserService.class,protocol = "dubbo")
public class UserServiceImpl implements UserService {
    @Override
    public String sayHello(String name) {
        WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
        UserService bean = wac.getBean(UserService.class);
        System.out.println(bean);
        return "8083 hello" + name;
    }

    @Override
    public String sayHello2(String name) {
        return "8083 hello " + name;
    }

    @Override
    public String sayHello3(String name) {
        return "8083 hello " + name;
    }

}
